<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>qLibc: containers/qgrow.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">qLibc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('qgrow_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">qgrow.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Grow container that handles growable objects.  
<a href="#details">More...</a></p>

<p><a href="qgrow_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a3a0165e2eba9d9098f2e448791e8aae9"><td class="memItemLeft" align="right" valign="top">qgrow_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a3a0165e2eba9d9098f2e448791e8aae9">qgrow</a> (int options)</td></tr>
<tr class="memdesc:a3a0165e2eba9d9098f2e448791e8aae9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize grow.  <a href="#a3a0165e2eba9d9098f2e448791e8aae9">More...</a><br/></td></tr>
<tr class="separator:a3a0165e2eba9d9098f2e448791e8aae9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a313f8b8da26b36f9558525efe34cda29"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a313f8b8da26b36f9558525efe34cda29">qgrow_add</a> (qgrow_t *grow, const void *data, size_t size)</td></tr>
<tr class="memdesc:a313f8b8da26b36f9558525efe34cda29"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;add(): Stack object  <a href="#a313f8b8da26b36f9558525efe34cda29">More...</a><br/></td></tr>
<tr class="separator:a313f8b8da26b36f9558525efe34cda29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e4759834172363db2e63799da00696b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a0e4759834172363db2e63799da00696b">qgrow_addstr</a> (qgrow_t *grow, const char *str)</td></tr>
<tr class="memdesc:a0e4759834172363db2e63799da00696b"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;addstr(): Stack string  <a href="#a0e4759834172363db2e63799da00696b">More...</a><br/></td></tr>
<tr class="separator:a0e4759834172363db2e63799da00696b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c52a8b3243100e3f2b7a97f47b6b992"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a6c52a8b3243100e3f2b7a97f47b6b992">qgrow_addstrf</a> (qgrow_t *grow, const char *format,...)</td></tr>
<tr class="memdesc:a6c52a8b3243100e3f2b7a97f47b6b992"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;addstrf(): Stack formatted string  <a href="#a6c52a8b3243100e3f2b7a97f47b6b992">More...</a><br/></td></tr>
<tr class="separator:a6c52a8b3243100e3f2b7a97f47b6b992"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e37ab3040be6523fc93a135aea45949"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a3e37ab3040be6523fc93a135aea45949">qgrow_size</a> (qgrow_t *grow)</td></tr>
<tr class="memdesc:a3e37ab3040be6523fc93a135aea45949"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;size(): Returns the number of elements in this grow.  <a href="#a3e37ab3040be6523fc93a135aea45949">More...</a><br/></td></tr>
<tr class="separator:a3e37ab3040be6523fc93a135aea45949"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec52e4932ddb3e1f29b95540f2231ac7"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#aec52e4932ddb3e1f29b95540f2231ac7">qgrow_datasize</a> (qgrow_t *grow)</td></tr>
<tr class="memdesc:aec52e4932ddb3e1f29b95540f2231ac7"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;datasize(): Returns the sum of total element size in this grow.  <a href="#aec52e4932ddb3e1f29b95540f2231ac7">More...</a><br/></td></tr>
<tr class="separator:aec52e4932ddb3e1f29b95540f2231ac7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8dcd5f0d8fce7d4c9d1727076823019"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#af8dcd5f0d8fce7d4c9d1727076823019">qgrow_toarray</a> (qgrow_t *grow, size_t *size)</td></tr>
<tr class="memdesc:af8dcd5f0d8fce7d4c9d1727076823019"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;toarray(): Returns the serialized chunk containing all the elements in this grow.  <a href="#af8dcd5f0d8fce7d4c9d1727076823019">More...</a><br/></td></tr>
<tr class="separator:af8dcd5f0d8fce7d4c9d1727076823019"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1a0aaa7efbdbb40bac079d6ad103a8e"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#ab1a0aaa7efbdbb40bac079d6ad103a8e">qgrow_tostring</a> (qgrow_t *grow)</td></tr>
<tr class="memdesc:ab1a0aaa7efbdbb40bac079d6ad103a8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;tostring(): Returns a string representation of this grow, containing string representation of each element.  <a href="#ab1a0aaa7efbdbb40bac079d6ad103a8e">More...</a><br/></td></tr>
<tr class="separator:ab1a0aaa7efbdbb40bac079d6ad103a8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a748f12b95d3e7f199e77a503070fe62b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a748f12b95d3e7f199e77a503070fe62b">qgrow_clear</a> (qgrow_t *grow)</td></tr>
<tr class="memdesc:a748f12b95d3e7f199e77a503070fe62b"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;clear(): Removes all of the elements from this grow.  <a href="#a748f12b95d3e7f199e77a503070fe62b">More...</a><br/></td></tr>
<tr class="separator:a748f12b95d3e7f199e77a503070fe62b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a093d851a279a44373605d7c57d498d4c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a093d851a279a44373605d7c57d498d4c">qgrow_debug</a> (qgrow_t *grow, FILE *out)</td></tr>
<tr class="memdesc:a093d851a279a44373605d7c57d498d4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;debug(): Print out stored elements for debugging purpose.  <a href="#a093d851a279a44373605d7c57d498d4c">More...</a><br/></td></tr>
<tr class="separator:a093d851a279a44373605d7c57d498d4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00f87daf5492d6a042fca6e310086560"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="qgrow_8c.html#a00f87daf5492d6a042fca6e310086560">qgrow_free</a> (qgrow_t *grow)</td></tr>
<tr class="memdesc:a00f87daf5492d6a042fca6e310086560"><td class="mdescLeft">&#160;</td><td class="mdescRight">qgrow-&gt;free(): De-allocate grow  <a href="#a00f87daf5492d6a042fca6e310086560">More...</a><br/></td></tr>
<tr class="separator:a00f87daf5492d6a042fca6e310086560"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Grow container that handles growable objects. </p>
<p>qgrow container is a grow implementation. It implements a growable array of objects and it extends qlist container that allow a linked-list to be treated as a grow.</p>
<div class="fragment"><div class="line">[Code sample - Object]</div>
<div class="line">qgrow_t *grow = <a class="code" href="qgrow_8c.html#a3a0165e2eba9d9098f2e448791e8aae9">qgrow</a>(QGROW_THREADSAFE);</div>
<div class="line"></div>
<div class="line"><span class="comment">// add elements</span></div>
<div class="line">grow-&gt;addstr(grow, <span class="stringliteral">&quot;AB&quot;</span>);      <span class="comment">// no need to supply size</span></div>
<div class="line">grow-&gt;addstrf(grow, <span class="stringliteral">&quot;%d&quot;</span>, 12); <span class="comment">// for formatted string</span></div>
<div class="line">grow-&gt;addstr(grow, <span class="stringliteral">&quot;CD&quot;</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// get the chunk as a string</span></div>
<div class="line"><span class="keywordtype">char</span> *<span class="keyword">final</span> = grow-&gt;tostring(grow);</div>
<div class="line"></div>
<div class="line"><span class="comment">// print out</span></div>
<div class="line">printf(<span class="stringliteral">&quot;Number of elements = %zu\n&quot;</span>, grow-&gt;size(grow));</div>
<div class="line">printf(<span class="stringliteral">&quot;Final string = %s\n&quot;</span>, <span class="keyword">final</span>);</div>
<div class="line"></div>
<div class="line"><span class="comment">// release</span></div>
<div class="line">free(<span class="keyword">final</span>);</div>
<div class="line">grow-&gt;free(grow);</div>
<div class="line"></div>
<div class="line">[Result]</div>
<div class="line">Number of elements = 3</div>
<div class="line">Final <span class="keywordtype">string</span> = AB12CD</div>
</div><!-- fragment --><div class="fragment"><div class="line">[Code sample - Object]</div>
<div class="line"><span class="comment">// sample object</span></div>
<div class="line"><span class="keyword">struct </span>sampleobj {</div>
<div class="line">  <span class="keywordtype">int</span> num;</div>
<div class="line">  <span class="keywordtype">char</span> str[10];</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// get new grow</span></div>
<div class="line">qgrow_t *grow = <a class="code" href="qgrow_8c.html#a3a0165e2eba9d9098f2e448791e8aae9">qgrow</a>();</div>
<div class="line"></div>
<div class="line"><span class="comment">// add objects</span></div>
<div class="line"><span class="keywordtype">int</span> i;</div>
<div class="line"><span class="keyword">struct </span>sampleobj obj;</div>
<div class="line"><span class="keywordflow">for</span>(i = 0; i &lt; 3; i++) {</div>
<div class="line">  <span class="comment">// filling object with sample data</span></div>
<div class="line">  obj.num  = i;</div>
<div class="line">  sprintf(obj.str, <span class="stringliteral">&quot;hello%d&quot;</span>, i);</div>
<div class="line"></div>
<div class="line">  <span class="comment">// stack</span></div>
<div class="line">  grow-&gt;add(grow, (<span class="keywordtype">void</span> *)&amp;obj, <span class="keyword">sizeof</span>(<span class="keyword">struct</span> sampleobj));</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">// final</span></div>
<div class="line"><span class="keyword">struct </span>sampleobj *<span class="keyword">final</span>;</div>
<div class="line"><span class="keyword">final</span> = (<span class="keyword">struct </span>sampleobj *)grow-&gt;toarray(grow, NULL);</div>
<div class="line"></div>
<div class="line"><span class="comment">// print out</span></div>
<div class="line">printf(<span class="stringliteral">&quot;Number of Objects = %zu\n&quot;</span>, grow-&gt;size(grow));</div>
<div class="line"><span class="keywordflow">for</span>(i = 0; i &lt; grow-&gt;size(grow); i++) {</div>
<div class="line">  printf(<span class="stringliteral">&quot;Object%d %d, %s\n&quot;</span>, i+1, <span class="keyword">final</span>[i].num, <span class="keyword">final</span>[i].str);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">// release</span></div>
<div class="line">free(<span class="keyword">final</span>);</div>
<div class="line">grow-&gt;free(grow);</div>
<div class="line"></div>
<div class="line">[Result]</div>
<div class="line">Number of Objects = 3</div>
<div class="line">Object1 0, hello0</div>
<div class="line">Object2 1, hello1</div>
<div class="line">Object3 2, hello2</div>
</div><!-- fragment --> 
<p>Definition in file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a3a0165e2eba9d9098f2e448791e8aae9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">qgrow_t* qgrow </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>options</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize grow. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">options</td><td>combination of initialization options.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>qgrow_t container pointer. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">errno</td><td>will be set in error condition.<ul>
<li>ENOMEM : Memory allocation failure.</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><span class="comment">// allocate memory</span></div>
<div class="line">qgrow_t *grow = <a class="code" href="qgrow_8c.html#a3a0165e2eba9d9098f2e448791e8aae9">qgrow</a>(QGROW_THREADSAFE);</div>
<div class="line">grow-&gt;free(grow);</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Available options:<ul>
<li>QGROW_THREADSAFE - make it thread-safe. </li>
</ul>
</dd></dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00134">134</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="a313f8b8da26b36f9558525efe34cda29"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qgrow_add </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;add(): Stack object </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer. </td></tr>
    <tr><td class="paramname">object</td><td>a pointer of object data </td></tr>
    <tr><td class="paramname">size</td><td>size of object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise returns false </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">errno</td><td>will be set in error condition.<ul>
<li>EINVAL : Invalid argument.</li>
<li>ENOMEM : Memory allocation failure. </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00178">178</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="a0e4759834172363db2e63799da00696b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qgrow_addstr </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;addstr(): Stack string </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer. </td></tr>
    <tr><td class="paramname">str</td><td>a pointer of string</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise returns false </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">errno</td><td>will be set in error condition.<ul>
<li>EINVAL : Invalid argument.</li>
<li>ENOMEM : Memory allocation failure. </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00193">193</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="a6c52a8b3243100e3f2b7a97f47b6b992"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qgrow_addstrf </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;addstrf(): Stack formatted string </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer. </td></tr>
    <tr><td class="paramname">format</td><td>string format</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise returns false </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">errno</td><td>will be set in error condition.<ul>
<li>EINVAL : Invalid argument.</li>
<li>ENOMEM : Memory allocation failure. </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00208">208</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3e37ab3040be6523fc93a135aea45949"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t qgrow_size </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;size(): Returns the number of elements in this grow. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of elements in this grow. </dd></dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00229">229</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="aec52e4932ddb3e1f29b95540f2231ac7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t qgrow_datasize </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;datasize(): Returns the sum of total element size in this grow. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the sum of total element size in this grow. </dd></dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00241">241</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="af8dcd5f0d8fce7d4c9d1727076823019"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* qgrow_toarray </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;toarray(): Returns the serialized chunk containing all the elements in this grow. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer. </td></tr>
    <tr><td class="paramname">size</td><td>if size is not NULL, merged object size will be stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer of finally merged elements(malloced), otherwise returns NULL </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">errno</td><td>will be set in error condition.<ul>
<li>ENOENT : empty.</li>
<li>ENOMEM : Memory allocation failure. </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00258">258</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="ab1a0aaa7efbdbb40bac079d6ad103a8e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* qgrow_tostring </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;tostring(): Returns a string representation of this grow, containing string representation of each element. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer of finally merged strings(malloced), otherwise returns NULL </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">errno</td><td>will be set in error condition.<ul>
<li>ENOENT : empty.</li>
<li>ENOMEM : Memory allocation failure.</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Return string is always terminated by '\0'. </dd></dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00276">276</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="a748f12b95d3e7f199e77a503070fe62b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qgrow_clear </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;clear(): Removes all of the elements from this grow. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00285">285</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="a093d851a279a44373605d7c57d498d4c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qgrow_debug </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>out</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;debug(): Print out stored elements for debugging purpose. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer. </td></tr>
    <tr><td class="paramname">out</td><td>output stream FILE descriptor such like stdout, stderr.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, otherwise returns false. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">errno</td><td>will be set in error condition.<ul>
<li>EIO : Invalid output stream. </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00299">299</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
<a class="anchor" id="a00f87daf5492d6a042fca6e310086560"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void qgrow_free </td>
          <td>(</td>
          <td class="paramtype">qgrow_t *&#160;</td>
          <td class="paramname"><em>grow</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>qgrow-&gt;free(): De-allocate grow </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">grow</td><td>qgrow_t container pointer. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="qgrow_8c_source.html#l00308">308</a> of file <a class="el" href="qgrow_8c_source.html">qgrow.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_0b61c55142250c0cc363383afd8075a4.html">containers</a></li><li class="navelem"><a class="el" href="qgrow_8c.html">qgrow.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
